package com.zb.test;

import java.util.List;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.zb.Service.WorkService;
import com.zb.entity.Department;
import com.zb.entity.Dictionary;
import com.zb.entity.Role;
import com.zb.entity.User;
import com.zb.entity.Work;

public class Tset5 {
	public static void main(String[] args) {
		ApplicationContext ac = new ClassPathXmlApplicationContext(
				"applicationContext.xml");
		WorkService ws = (WorkService)ac.getBean("WorkService");
//		List<Work> list = ws.findWork();
//		for (Work work : list) {
//			System.out.println(work.getContent()+work.getDictionary());
//		}
//		Work w = ws.getWorkById(22);
//		System.out.println(w.getContent());
//		Work w = new Work();
//		User u = new User();
//		Role r = new Role();
//		Dictionary d = new Dictionary();
//		Department dt = new Department();
//		u.setId(4);
//		r.setId(1);
//		d.setId(1);
//	    dt.setId(2);
//		
//		
//		w.setId(24);
//	    w.setUser(u);
//	    w.setDictionary(d); 
//		w.setDepartment(dt);
//		w.setRole(r);
//		w.setStarttime("2017-4-27");
//		w.setEndtime("2017-5-1");
//		w.setContent("学习");
//		w.setWordconten("net");
//		w.setUsemoney(2000);
//		w.setState(1);
//	//	ws.saveWork(w);
//		ws.updateWork(w);
		ws.delectWork(24);
		
	}
}
